<?php
error_reporting(E_ALL ^ E_NOTICE);

set_time_limit(0);
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("comzs", $con);
date_default_timezone_set("PRC"); //timezone
#$dateTime = date("Y-m-d",strtotime("-1 day"));
$dateTime = date("Y-m-d");

    $deviceid_query = mysql_query("select DISTINCT deviceid,dataTime from  comzs_query_temp"); //id

while ($deviceid[dataTime] ='0000-00-00') {
   $sql = "UPDATE  comzs_query_temp SET firstLogin= '$deviceid[dataTime]' WHERE deviceid= '$deviceid[deviceid]' and firstLogin ='0000-00-00'";
   if(mysql_query($sql,$con)){
    echo "1 update is ok!";
} else {
    echo "failed".mysql_error();
}
}

mysql_close($con);
?>